package com.chixing.fourteen.controller;

import com.alibaba.fastjson.JSONObject;
import com.chixing.fourteen.pojo.Model;
import com.chixing.fourteen.service.ModelService;
import com.chixing.fourteen.service.impl.ModelServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/test")
@ResponseBody
public class TestController {

    @Autowired
    private ModelService modelService = new ModelServiceImpl();

    @GetMapping("/getModel")
    public String Model(){
        return JSONObject.toJSONString(modelService.findAll());
    }
}
